//
// Created by Wei on 2022/5/15.
//

#ifndef B_PLUS_DB_PAGE_HEADER_H
#define B_PLUS_DB_PAGE_HEADER_H
typedef struct PAGE_HEADER {
private:
    //12 bytes
    unsigned short page_heap_top;//未使用的空间最小地址
    unsigned short page_n_heap;//本页记录数量，含最大最小已删除
    unsigned short page_free;//第一个标记为删除的记录的地址，沿着这个走下去可以重新利用
    unsigned short page_garbage;//已删除记录所占用的字节数
    unsigned short page_n_recs;//本页记录数量，不含最大最小已删除
    unsigned short page_level;//此页在B+数的层级

public:
    unsigned short getPageHeapTop() const;

    void setPageHeapTop(unsigned short pageHeapTop);

    unsigned short getPageNHeap() const;

    void setPageNHeap(unsigned short pageNHeap);

    unsigned short getPageFree() const;

    void setPageFree(unsigned short pageFree);

    unsigned short getPageGarbage() const;

    void setPageGarbage(unsigned short pageGarbage);


    unsigned short getPageNRecs() const;

    void setPageNRecs(unsigned short pageNRecs);

    unsigned short getPageLevel() const;

    void setPageLevel(unsigned short pageLevel);

} PAGE_HEADER;
#endif //B_PLUS_DB_PAGE_HEADER_H
